package com.example.cofeed.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.cofeed.R;
import com.example.cofeed.entity.Suoyin;

public class SearchHotAdapter extends BaseQuickAdapter<Suoyin, BaseViewHolder> {
    public SearchHotAdapter() {
        super(R.layout.adapter_search_hot);
    }

    @Override
    protected void convert(BaseViewHolder helper, Suoyin item) {
        switch (helper.getAdapterPosition()) {
            case 0:
                helper.setTextColor(R.id.tv_position, mContext.getResources().getColor(R.color.colorRed));
                break;
            case 1:
                helper.setTextColor(R.id.tv_position, mContext.getResources().getColor(R.color.colorOrangeHalfTransparent));
                break;
            case 2:
                helper.setTextColor(R.id.tv_position, mContext.getResources().getColor(R.color.colorRed));
                break;
            default:
                helper.setTextColor(R.id.tv_position, mContext.getResources().getColor(R.color.colorTextSub));
                break;
        }
        helper.setText(R.id.tv_position, (helper.getAdapterPosition() + 1) + "");
        helper.setText(R.id.tv_name, item.title);

    }

}
